<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../../stpr.css">
</head>
<body>
<table  border=0 width="100%" cellpadding=0 cellspacing=0><tr valign="baseline">
<td valign="baseline" class="function"><b class="function">MPERCEPTRON</b>
<td valign="baseline" align="right" class="function"><a href="../../linear/finite/index.html" target="mdsdir"><img border = 0 src="../../up.gif"></a></table>
  <p><b>Perceptron algorithm to train linear machine.</b></p>
  <hr>
<div class='code'><code>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;mpeceptron(data)</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;mpeceptron(data,options)</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;mpeceptron(data,options,init_model)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Description:</span></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;mperceptron(data)&nbsp;uses&nbsp;the&nbsp;Perceptron&nbsp;learning&nbsp;rule</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;to&nbsp;train&nbsp;linear&nbsp;machine&nbsp;(multi-class&nbsp;linear&nbsp;classitfier).</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;The&nbsp;multi-class&nbsp;problem&nbsp;is&nbsp;transformed&nbsp;to&nbsp;the&nbsp;single-class</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;one&nbsp;using&nbsp;the&nbsp;Kessler's&nbsp;construction&nbsp;[<a href="../../references.html#DHS01" title = "R.O.Duda, P.E.Hart, and D.G.Stork. Pattern Classification. John Wiley & Sons, 2nd. edition, 2001." >DHS01</a>][<a href="../../references.html#SH10" title = "M.I.Schlesinger and V.Hlavac. Ten lectures on statistical and structural pattern recognition. Kluwer Academic Publishers, 2002." >SH10</a>].</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;mperceptron(data,options)&nbsp;specifies&nbsp;stopping&nbsp;condition&nbsp;of</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;the&nbsp;algorithm&nbsp;in&nbsp;structure&nbsp;options:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;.tmax&nbsp;[1x1]...&nbsp;maximal&nbsp;number&nbsp;of&nbsp;iterations.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;mperceptron(data,options,init_model)&nbsp;specifies&nbsp;initial&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;model&nbsp;which&nbsp;must&nbsp;contain:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;.W&nbsp;[dim&nbsp;x&nbsp;nclass]&nbsp;...&nbsp;Normal&nbsp;vectors.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;.b&nbsp;[nclass&nbsp;x&nbsp;1]&nbsp;...&nbsp;Biases.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>&nbsp;&nbsp;data&nbsp;[struct]&nbsp;Labeled&nbsp;training&nbsp;data:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.X&nbsp;[dim&nbsp;x&nbsp;num_data]&nbsp;Training&nbsp;vectors.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.y&nbsp;[1&nbsp;x&nbsp;num_data]&nbsp;Labels&nbsp;(1,2,...,nclass).</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;options&nbsp;[struct]&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.tmax&nbsp;[1x1]&nbsp;Maximal&nbsp;number&nbsp;of&nbsp;iterations&nbsp;(default&nbsp;tmax=inf).</span><br>
<span class=help>&nbsp;&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;init_model&nbsp;[struct]&nbsp;Initial&nbsp;model;&nbsp;must&nbsp;contain&nbsp;items&nbsp;.W,&nbsp;.b.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Output:</span></span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;[struct]&nbsp;Multi-class&nbsp;linear&nbsp;classifier:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.W&nbsp;[dim&nbsp;x&nbsp;nclass]&nbsp;Normal&nbsp;vectors.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.b&nbsp;[nclass&nbsp;x&nbsp;1]&nbsp;Biases.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.exitflag&nbsp;[1x1]&nbsp;1&nbsp;...&nbsp;perceptron&nbsp;has&nbsp;converged.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;0&nbsp;...&nbsp;number&nbsp;of&nbsp;iterations&nbsp;exceeded&nbsp;tmax.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.t&nbsp;[1x1]&nbsp;Number&nbsp;of&nbsp;iterations.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Example:</span></span><br>
<span class=help>&nbsp;&nbsp;data&nbsp;=&nbsp;load('pentagon');</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;mperceptron(&nbsp;data&nbsp;);</span><br>
<span class=help>&nbsp;&nbsp;figure;&nbsp;ppatterns(&nbsp;data&nbsp;);&nbsp;pboundary(&nbsp;model&nbsp;);</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=also_field>See also </span><span class=also></span><br>
<span class=help><span class=also>&nbsp;&nbsp;<a href = "../../linear/finite/perceptron.html" target="mdsbody">PERCEPTRON</a>,&nbsp;<a href = "../../linear/linclass.html" target="mdsbody">LINCLASS</a>,&nbsp;<a href = "../../linear/finite/ekozinec.html" target="mdsbody">EKOZINEC</a>.</span><br>
<span class=help></span><br>
</code></div>
  <hr>
  <b>Source:</b> <a href= "../../linear/finite/list/mperceptron.html">mperceptron.m</a>
  <p><b class="info_field">Modifications: </b> <br>
 21-may-2004, VF<br>
 18-may-2004, VF<br>

</body>
</html>
